# 推荐写法
my_set={1,2,3,4,'a'}
# 不太推荐
my_set2 = set([1, 2, 3, 'a', 'b', 'c'])
# print(my_set,my_set2)
# 并集
# my_set3=my_set | my_set2
# my_set3=my_set.union(my_set2)
# print(my_set3)

# 交集
# my_set4=my_set & my_set2
# my_set4=my_set.intersection(my_set2)
# print(my_set4)
# 两个集合中没有同时出现的元素
# my_set5=my_set.symmetric_difference(my_set2)
# print(my_set5)
# 错误语法: 列表不能作为集合的元素
# my_set6 = {[1, 2], [3, 4]}
# 元组可以作为集合的元素, 元组不能改变
# my_set6={(1,2),(3,4)}
# print(my_set6)

my_tuple=('张三',20)
"""
错误语法: 元组的元素不能修改
my_tuple[0]='李四'
"""
print(my_tuple,end="\n")

# print(my_tuple[0]==tuple[1])
is_exists=20 in my_tuple
print(is_exists,'is_exists',sep="||")

